import Vue from 'vue'
// 自定义组件
const requireComponent = require.context(
  // Look for files in the current directory
  './',
  // Do not look in subdirectories
  true,
  // Only include "_base-" prefixed .vue files
  /[A-Z|a-z]\w+\.vue$/
)

// For each matching file name...
requireComponent.keys().forEach((fileName) => {
  // Get the component config
  const componentConfig = requireComponent(fileName)
  // Get the PascalCase version of the component name
  const componentName = fileName
    // Remove the "./_" from the beginning
    .split('/')
    .pop()
    .replace(/\.\w+$/, '')
  //console.log(componentName,'32222222222')

  // Globally register the component
  Vue.component(componentName, componentConfig.default || componentConfig)
})
